package zw_201_300.zw_263_丑数;


import java.util.HashMap;

class Solution {

    public static void main(String[] args) {
        int n = 125;
        boolean b = isUgly(n);
        System.out.println(b);
    }

    public static boolean isUgly(int n) {
        if (n <= 0) return false;
        while (n > 5) {
            if (n % 5 == 0) n /= 5;
            else if (n % 3 == 0) n /= 3;
            else if (n % 2 == 0) n /= 2;
            else return false;
        }
        return true;
    }
}